import UIKit

@available(iOS 2.0, *)
extension QKC where AA :UISegmentedControl {
		// if set, then we don't keep showing selected state after tracking ends. default is NO
    open func isMomentary_qk_s(_ isMomentary:  Bool ) -> QKC<AA,YY,ZZ, Bool >{
		return link(next: isMomentary).then_QK { $0.value.isMomentary = isMomentary }
	}
    open func isMomentary_qk_g() -> QKC<AA,YY,ZZ, Bool >{
		 self +^ self.value.isMomentary
	}

    open func numberOfSegments_qk_g() -> QKC<AA,YY,ZZ, Int >{
		 self +^ self.value.numberOfSegments
	}

	// For segments whose width value is 0, setting this property to YES attempts to adjust segment widths based on their content widths. Default is NO.
    @available(iOS 5.0, *)
    open func apportionsSegmentWidthsByContent_qk_s(_ apportionsSegmentWidthsByContent:  Bool) -> QKC<AA,YY,ZZ, Bool>{
		return link(next: apportionsSegmentWidthsByContent).then_QK { $0.value.apportionsSegmentWidthsByContent = apportionsSegmentWidthsByContent }
	}
    @available(iOS 5.0, *)
    open func apportionsSegmentWidthsByContent_qk_g() -> QKC<AA,YY,ZZ, Bool>{
		 self +^ self.value.apportionsSegmentWidthsByContent
	}

	// the UIControlEventValueChanged action is invoked when the segment changes via a user event. set to UISegmentedControlNoSegment to turn off selection
    open func selectedSegmentIndex_qk_s(_ selectedSegmentIndex:  Int) -> QKC<AA,YY,ZZ, Int>{
		return link(next: selectedSegmentIndex).then_QK { $0.value.selectedSegmentIndex = selectedSegmentIndex }
	}
    open func selectedSegmentIndex_qk_g() -> QKC<AA,YY,ZZ, Int>{
		 self +^ self.value.selectedSegmentIndex
	}

	// The color to use for highlighting the currently selected segment.
    @available(iOS 13.0, *)
    open func selectedSegmentTintColor_qk_s(_ selectedSegmentTintColor:  UIColor?) -> QKC<AA,YY,ZZ, UIColor?>{
		return link(next: selectedSegmentTintColor).then_QK { $0.value.selectedSegmentTintColor = selectedSegmentTintColor }
	}
    @available(iOS 13.0, *)
    open func selectedSegmentTintColor_qk_g() -> QKC<AA,YY,ZZ, UIColor?>{
		 self +^ self.value.selectedSegmentTintColor
	}

		// insert before segment number. 0..#segments. value pinned
    open func insertSegment_qk_f(withTitle title: String?, at segment: Int, animated: Bool) -> QKC<AA,YY,ZZ, String?>{
		 self +^ self.value.insertSegment(withTitle:title, at:segment, animated:animated) +^ title
	}

    open func insertSegment_qk_f(with image: UIImage?, at segment: Int, animated: Bool) -> QKC<AA,YY,ZZ, UIImage?>{
		 self +^ self.value.insertSegment(with:image, at:segment, animated:animated) +^ image
	}

    open func removeSegment_qk_f(at segment: Int, animated: Bool) -> QKC<AA,YY,ZZ, Int>{
		 self +^ self.value.removeSegment(at:segment, animated:animated) +^ segment
	}

    open func removeAllSegments_qk_f() -> QKC<AA,YY,ZZ,Void>{
		 self +^ self.value.removeAllSegments()
	}

		// can only have image or title, not both. must be 0..#segments - 1 (or ignored). default is nil
    open func setTitle_qk_f(_ title: String?, forSegmentAt segment: Int) -> QKC<AA,YY,ZZ, String?>{
		 self +^ self.value.setTitle(title, forSegmentAt:segment) +^ title
	}

    open func titleForSegment_qk_f(at segment: Int) -> QKC<AA,YY,ZZ,String?>{
		 self +^ self.value.titleForSegment(at:segment)
	}

		// can only have image or title, not both. must be 0..#segments - 1 (or ignored). default is nil
    open func setImage_qk_f(_ image: UIImage?, forSegmentAt segment: Int) -> QKC<AA,YY,ZZ, UIImage?>{
		 self +^ self.value.setImage(image, forSegmentAt:segment) +^ image
	}

    open func imageForSegment_qk_f(at segment: Int) -> QKC<AA,YY,ZZ,UIImage?>{
		 self +^ self.value.imageForSegment(at:segment)
	}

		// set to 0.0 width to autosize. default is 0.0
    open func setWidth_qk_f(_ width: CGFloat, forSegmentAt segment: Int) -> QKC<AA,YY,ZZ, CGFloat>{
		 self +^ self.value.setWidth(width, forSegmentAt:segment) +^ width
	}

    open func widthForSegment_qk_f(at segment: Int) -> QKC<AA,YY,ZZ,CGFloat>{
		 self +^ self.value.widthForSegment(at:segment)
	}

		// adjust offset of image or text inside the segment. default is (0,0)
    open func setContentOffset_qk_f(_ offset: CGSize, forSegmentAt segment: Int) -> QKC<AA,YY,ZZ, CGSize>{
		 self +^ self.value.setContentOffset(offset, forSegmentAt:segment) +^ offset
	}

    open func contentOffsetForSegment_qk_f(at segment: Int) -> QKC<AA,YY,ZZ,CGSize>{
		 self +^ self.value.contentOffsetForSegment(at:segment)
	}

		// default is YES
    open func setEnabled_qk_f(_ enabled: Bool, forSegmentAt segment: Int) -> QKC<AA,YY,ZZ, Bool>{
		 self +^ self.value.setEnabled(enabled, forSegmentAt:segment) +^ enabled
	}

    open func isEnabledForSegment_qk_f(at segment: Int) -> QKC<AA,YY,ZZ,Bool>{
		 self +^ self.value.isEnabledForSegment(at:segment)
	}

    @available(iOS 5.0, *)
    open func setBackgroundImage_qk_f(_ backgroundImage: UIImage?, for state: UIControl.State, barMetrics: UIBarMetrics) -> QKC<AA,YY,ZZ, UIImage?>{
		 self +^ self.value.setBackgroundImage(backgroundImage, for:state, barMetrics:barMetrics) +^ backgroundImage
	}

    @available(iOS 5.0, *)
    open func backgroundImage_qk_f(for state: UIControl.State, barMetrics: UIBarMetrics) -> QKC<AA,YY,ZZ,UIImage?>{
		 self +^ self.value.backgroundImage(for:state, barMetrics:barMetrics)
	}

    @available(iOS 5.0, *)
    open func setDividerImage_qk_f(_ dividerImage: UIImage?, forLeftSegmentState leftState: UIControl.State, rightSegmentState rightState: UIControl.State, barMetrics: UIBarMetrics) -> QKC<AA,YY,ZZ, UIImage?>{
		 self +^ self.value.setDividerImage(dividerImage, forLeftSegmentState:leftState, rightSegmentState:rightState, barMetrics:barMetrics) +^ dividerImage
	}

    @available(iOS 5.0, *)
    open func dividerImage_qk_f(forLeftSegmentState leftState: UIControl.State, rightSegmentState rightState: UIControl.State, barMetrics: UIBarMetrics) -> QKC<AA,YY,ZZ,UIImage?>{
		 self +^ self.value.dividerImage(forLeftSegmentState:leftState, rightSegmentState:rightState, barMetrics:barMetrics)
	}

    @available(iOS 5.0, *)
    open func setTitleTextAttributes_qk_f(_ attributes: [NSAttributedString.Key : Any]?, for state: UIControl.State) -> QKC<AA,YY,ZZ, [NSAttributedString.Key : Any]?>{
		 self +^ self.value.setTitleTextAttributes(attributes, for:state) +^ attributes
	}

    

    @available(iOS 5.0, *)
    open func setContentPositionAdjustment_qk_f(_ adjustment: UIOffset, forSegmentType leftCenterRightOrAlone: UISegmentedControl.Segment, barMetrics: UIBarMetrics) -> QKC<AA,YY,ZZ, UIOffset>{
		 self +^ self.value.setContentPositionAdjustment(adjustment, forSegmentType:leftCenterRightOrAlone, barMetrics:barMetrics) +^ adjustment
	}

    @available(iOS 5.0, *)
    open func contentPositionAdjustment_qk_f(forSegmentType leftCenterRightOrAlone: UISegmentedControl.Segment, barMetrics: UIBarMetrics) -> QKC<AA,YY,ZZ,UIOffset>{
		 self +^ self.value.contentPositionAdjustment(forSegmentType:leftCenterRightOrAlone, barMetrics:barMetrics)
	}

}

